#!/bin/bash

version=3.8.5

install_packages build-essential libx11-dev libxpm-dev libxt-dev libxext-dev pkg-config libxml2-dev libgtk-3-dev libxinerama-dev libxtst-dev libgsl-dev || exit 1

cd /tmp || error "Could not move to /tmp folder"
rm -rf /tmp/xsnow*
wget -O xsnow.tar.gz https://www.ratrabbit.nl/downloads/xsnow/xsnow-${version}.tar.gz
tar -xvf xsnow.tar.gz
cd xsnow-${version} || error "Could not move to xsnow directory folder"
./configure --prefix=/usr && make -j$(nproc) && sudo make install || error "Make install failed"
rm -rf /tmp/xsnow*
